<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
<div>
    <p onclick="handlerChange('history1')">history1</p>
    <p onclick="handlerChange('history2')">history2</p>
</div>
</body>
<script>
   function handlerChange(route){
    console.log('========current route=====')
    console.log(route)
    //param1:存储在浏览器中的state params2:history对象中的title param3:url
    window.history.pushState({test:'?test='},'test',"history1.html")
    console.log(history.state)
    }
    // window.history.pushState("/test",'test','test.html')
    // window.history.replaceState('/test2')
</script>

</html>